package com.groovy.base

class Example {

    static void main(String[] args) {
        //com.groovy.base.Example of a int datatype
        int x = 5;

        //com.groovy.base.Example of a long datatype
        long y = 100L;

        //com.groovy.base.Example of a floating point datatype
        float a = 10.56f;

        //com.groovy.base.Example of a double datatype
        double b = 10.5e40;

        //com.groovy.base.Example of a BigInteger datatype
        BigInteger bi = 30g;

        //com.groovy.base.Example of a BigDecimal datatype
        BigDecimal bd = 3.5g;

        println(x);
        println(y);
        println(a);
        println(b);
        println(bi);
        println(bd);


        // Defining a variable in lowercase
        int x1 = 5;

        // Defining a variable in uppercase
        int X = 6;

        // Defining a variable with the underscore in it's name
        def _Name = "Joe";

        println(x1);
        println(X);
        println(_Name);

        //Printing the value of the variables to the console
        println("The value of x is " + x1 + " The value of X is " + X);




        // groovy 的范围运算符
        def range = 5..10
        println(range)
        println(range.get(2))




    }
}
